package io.renren.modules.user.controller;/*
 * @Author
 * @Date  2019/8/5 16:32
 *  人员统计分析
 * */

import io.renren.common.utils.R;
import io.renren.modules.sys.controller.AbstractController;
import io.renren.modules.user.entity.TPeopleDictionaryEntity;
import io.renren.modules.user.entity.TPeopleEntity;
import io.renren.modules.user.entity.TPeopleFireDetachmentEntity;
import io.renren.modules.user.entity.vo.PeopleVo;
import io.renren.modules.user.entity.vo.PeopleZZVo;
import io.renren.modules.user.service.TPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/statistics")
public class PeopelStatisticsController extends AbstractController {

    @Autowired
    private TPeopleService tPeopleService;

    //人员统计分析
    @RequestMapping("/peopleCount")
    public R peopleCount(){
        List<TPeopleEntity> tPeopleEntities = tPeopleService.peopleCount();
        return R.ok().put("data",tPeopleEntities);
    }

    /*
    *支队人员统计分析
    * */
    @RequestMapping("/peopleDeptCount")
    public R peopleDeptCount(){
        List<TPeopleFireDetachmentEntity> tPeopleFireDetachmentList= tPeopleService.peopleDeptCount();
        return R.ok().put("data",tPeopleFireDetachmentList );
    }

    /*
     *支队人员统计分析
     * */
    @RequestMapping("/peopelTitleCount")
    public R peopelTitleCount(){
        List<TPeopleDictionaryEntity> tPeopleDictionaryEntities = tPeopleService.peopelTitleCount();
        return R.ok().put("data",tPeopleDictionaryEntities );
    }

    /*
     *合同期统计分析
     * */
    @RequestMapping("/peopleContractCount")
    public R peopleContractCount(){
        List<PeopleZZVo> peopleZZVos = tPeopleService.peopleContractCount();
        return R.ok().put("data",peopleZZVos );
    }

    /*
    * 自主人员男女分析
    * */
    @RequestMapping("/peopelStatistics")
    public R peopelStatistics(String deptId){
        List<TPeopleEntity> peopleVos =tPeopleService.peopelStatistics(deptId);
        return R.ok().put("data",peopleVos);
    }



}
